package cn.wsn2018.tools.model;

import cn.wsn2018.tools.model.Design.FieldDesign;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by NZX on 2018/12/12.
 */
public class DesignModels {
    public static List<FieldDesign> _1RTT;
    public static List<FieldDesign> _0RTT;
    public static List<FieldDesign> encNegMessage;
    public static List<FieldDesign> resendFields;
    static {
        _1RTT = new ArrayList<FieldDesign>();
        _1RTT.add(new FieldDesign("功能字段",1,"bit","认证协商功能字段",0,0,"0:代表1-RTT的ECDH密钥协商报文 1:代表1-RTT的PSK密钥协商报文","function",""));
        _1RTT.add(new FieldDesign("公钥字段",32,"bit","认证协商公钥字段",1,32,"由密钥生成算法ECDH_Generate_Key产生的客户端公钥","pubKey",""));
        _1RTT.add(new FieldDesign("verify字段",32,"bit","认证协商verify字段",33,64,"对收到的服务器发来的报文进行ECDSA签名算法验证","verify",""));
        _1RTT.add(new FieldDesign("signature字段",32,"bit","认证协商signature字段",65,96,"对客户端发送报文使用ECDSA数字算法签名","signature",""));
        _1RTT.add(new FieldDesign("ticketKey字段",32,"bit","认证协商ticketKey字段",97,128,"由服务器Server下发PSK{key，ticket{key}}","ticketKey",""));
        _1RTT.add(new FieldDesign("random字段",32,"bit","认证协商random字段",129,160,"随机数","random",""));

        _0RTT = new ArrayList<FieldDesign>();
        _0RTT.add(new FieldDesign("公钥字段",32,"bit","认证协商公钥字段",0,31,"由密钥生成算法ECDH_Generate_Key产生的公钥","pubKey",""));
        _0RTT.add(new FieldDesign("random字段",32,"bit","认证协商random字段",32,63,"产生的随机数,用于新旧报文的判别","random",""));
        _0RTT.add(new FieldDesign("signature字段",32,"bit","认证协商signature字段",64,95,"对发送报文使用ECDSA数字算法签名","signature",""));

        encNegMessage = new ArrayList<FieldDesign>();
        encNegMessage.add(new FieldDesign("加密方法字段",1,"bit","协商加密的方法",0,0,"用于标识加密方法,0代表3DES算法，1代表AES算法","algorithm",""));
        encNegMessage.add(new FieldDesign("加密模式字段",1,"bit","协商加密的模式",1,1,"用于标识加密模式,0代表ECB加密模式，1代表OFB模式","mode",""));
        encNegMessage.add(new FieldDesign("输出类型字段",1,"bit","协商加密的输出模式",2,2,"用于标识加密模式,0代表base64输出模式，1代表hex输出模式","output",""));
        encNegMessage.add(new FieldDesign("加密长度字段",64,"bit","协商加密的字段",3,66,"用于标识加密从多少位到多少位范围","range",""));

        resendFields = new ArrayList<FieldDesign>();
        resendFields.add(new FieldDesign("功能字段",1,"bit","重传功能标志字段",0,0,"用于标识是否是重传报文.0代表不是重传报文;1代表是重传报文","function",""));
        resendFields.add(new FieldDesign("序列号字段",32,"bit","重传报文唯一标识字段",1,32,"用于对每个报文的唯一标识","seq",""));
        resendFields.add(new FieldDesign("优先级字段",1,"bit","重传报文优先级字段",33,33,"重传报文的优先级,设置的数值越大优先级越高","level",""));
        resendFields.add(new FieldDesign("当前重传次数字段",4,"bit","重传报文第几次",33,33,"重传报文发送了多少次","count",""));

    }
}
